<html>
<head>
<title>Javascript SOAP client TEST</title>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">


<script language='JavaScript' src='./javascript/cookies.js'></script>
<script language='JavaScript' src='./javascript/SOAP/soapclient.js'></script>


</head>

<body>
	<DIV ID="myDiv">
	</DIV> 
	<script>
	
function procesaRespuestaXML(a,o){
alert (o);
	var x=o.selectNodes('return');
	alert (x.length);
	for (i=0;i<x.length;i++)
	{
		alert (x[i].childNodes[0].nodeValue);
		document.write(x[i].childNodes[0].nodeValue);
		document.write("<br />");
	} 

}
	
	
	
var soapHeaderParameters = new SOAPHeaderParameters();
session=new SqlSession();
session.timeout=10000;
if (session.sessionId=="") session.initiate="true";

auth=new BasicAuth();
auth.username="jmari";
auth.password="jmari";


soapHeaderParameters.add("sqlSession",session);
soapHeaderParameters.add("BasicAuth", auth);
//soapHeaderParameters.add("sqlSession" , options);

var soapParameters = new SOAPClientParameters();
soapParameters.add("idparte",425);


var node=document.createTextNode(soapParameters.toXml());
document.getElementById("myDiv").appendChild(node);
node=document.createTextNode(soapHeaderParameters.toXml());
document.getElementById("myDiv").appendChild(node);


SOAPClient.setTargetNamespace("org.jma.lib.soap.test.TimeService");
SOAPClient.invoke ("https://localhost:19999/timeService", "getTime", soapParameters,soapHeaderParameters, true, procesaRespuestaXML);
	</script>
</body>